{
  "nbformat": 4,
  "nbformat_minor": 2,
  "metadata": {},
  "cells": [
    {
      "metadata": {},
      "source": [
        "<td>\n",
        "   <a target=\"_blank\" href=\"https://labelbox.com\" ><img src=\"https://labelbox.com/blog/content/images/2021/02/logo-v4.svg\" width=256/></a>\n",
        "</td>"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "<td>\n",
        "<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/master/examples/exports/composite_mask_export.ipynb\" target=\"_blank\"><img\n",
        "src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n",
        "</td>\n",
        "\n",
        "<td>\n",
        "<a href=\"https://github.com/Labelbox/labelbox-python/tree/master/examples/exports/composite_mask_export.ipynb\" target=\"_blank\"><img\n",
        "src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n",
        "</td>"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "# Export composite masks \n",
        "##### **Composite masks are only available on raster segmentation projects**\n",
        "\n",
        "Composite masks are a combination of mask instances grouped in a single mask URL. \n",
        "\n",
        "The purpose of this demo is to demonstrate how to transition from exporting single masks to exporting composite masks. "
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "## Imports"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "%pip install -q \"labelbox[data]\""
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "import labelbox as lb\n",
        "import urllib.request\n",
        "from PIL import Image\n",
        "import json\n"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "## API Key and Client\n",
        "See the developer guide for [creating an API key](https://docs.labelbox.com/reference/create-api-key)."
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "API_KEY = \"\"\n",
        "client = lb.Client(api_key=API_KEY)\n",
        "client.enable_experimental = True ## This is required if using the export() streamable method"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "## Key differences between single mask instance and composite mask."
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "#### Composite masks\n",
        "**IMPORTANT :** The URL for the ```composite_mask``` from exports older than 30 days will no longer be accessible. To obtain a functional URL after this period, please generate a new export for the mask.\n",
        "1. A single mask url contains all mask instances from a single label. For videos a composite mask contains all mask instances for the frame in each label. \n",
        "2. The export and mask URL adhere to the following convention:\n",
        "  - ***Image example***\n",
        "```json \n",
        "  {\n",
        "    \"composite_mask\": {\n",
        "      \"url\": \"https://api.labelbox.com/api/v1/tasks/{task_id}/masks/{composite_mask_id}/index/1\",\n",
        "      \"color_rgb\": [\n",
        "          142,\n",
        "          220,\n",
        "          196\n",
        "      ]\n",
        "    }\n",
        "  }\n",
        "```\n",
        "  - ***Video example*** :\n",
        "  The export will adhere to the following URL convention by default.\n",
        "```json\n",
        "  {\n",
        "    \"composite_mask\": {\n",
        "      \"url\": \"https://api.labelbox.com/api/v1/tasks/{task_id}/masks/{composite_mask_id}/index/{frame_number}\",\n",
        "      \"color_rgb\": [\n",
        "        224,\n",
        "        17,\n",
        "        103\n",
        "      ]\n",
        "    }\n",
        "  }\n",
        "```\n",
        "3. A unique RGB color is assigned to each mask instance. The example below shows a composite mask of a label, and while it contains all mask instances, only the RGB color associated with this particular annotation will be filled in under the ```color_rgb``` field."
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "# Example on how to fetch a composite mask\n",
        "# The mask here shows all the mask instances associated with a label\n",
        "task_id = \"\"\n",
        "composite_mask_id = \"\"\n",
        "\n",
        "mask_url = f'https://api.labelbox.com/api/v1/tasks/{task_id}/masks/{composite_mask_id}/index/1'\n",
        "req = urllib.request.Request(mask_url, headers=client.headers)\n",
        "image = Image.open(urllib.request.urlopen(req))\n",
        "w, h = image.size\n",
        "new_w = w // 4\n",
        "new_h = h // 4\n",
        "\n",
        "image.resize((new_w, new_h), Image.BICUBIC)"
      ],
      "cell_type": "code",
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAoAAAAGqCAYAAACbEvXuAABUwklEQVR4Ae3dCYAcRb348arq7tnNHcKZcApJIEEQARGQEEWUm3AYVK6AaBLwRQwJoKAvRkGRECIP5cgTBFHeX/MUEhF5AnKLCogXhCNcogJy5M7uznR3/X81m8CS7G52Z3tmunu+rSG7M93VVZ+azPymTqU4EEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ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DZWJDf1cC5j7v+vyzENg+K5A7+2yuWAvlEGRerk8v0Qe/rNY3C+dvI/EK7d6fr6aX2rU1wXlRgCB7Au0v+9lvxyUAAEEqixwxuCJwwLbtrlW3shIRzvImMGdJPjbSyLAERIQbqm1HrT+G4o81mmuJG6Uo/yf8vMd1yN0AWVSRzlQXZuYy8m7f5dH5P8uL9KqF8ptV8ivS+T+L8ipzxmjH5ETXtal4j+ZwJFUjZAOAgikRcC9J3IggAACFQvM2PLkAWuKK4fJBOKx0lXsd0xIa7O7vMkM3XBPs3g36VgdUl6K2ipfzhkpwZbngkIJGoeUF0uWhNa1NHZMs7ufXYvkusNteSe/L3e/u3SsVqsl/Rfbfzfuub/L2c95Rj0aKfP3KAz/ydg9p8OBAAKNIEAA2Ai1TBkRSLnAGQOO2tKzvqxGI4eJRvlaDyxPndVqBwnett/Y/sUuYJTgsyRdtI/ITOaSRJIqtHaVir1nXZL95c9K32+7bsWCt9zvHAgggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAIIIJAOgf8P29iu755DGGwAAAAASUVORK5CYII=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGBA size=640x426>"
            ]
          },
          "metadata": {},
          "execution_count": 15
        }
      ],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "Here's an example of an entry featuring a composite mask (see image above) containing the mask instance's RGB color uniquely associated with the annotation.\n",
        "\n",
        "```json\n",
        "    {\n",
        "      \"feature_id\": \"clpk3ow9u006f14vs2w5qa9l3\",\n",
        "      \"feature_schema_id\": \"clpk3nvrv05bh08ua8fwqavng\",\n",
        "      \"name\": \"mask\",\n",
        "      \"value\": \"mask\",\n",
        "      \"annotation_kind\": \"ImageSegmentationMask\",\n",
        "      \"classifications\": [],\n",
        "      \"composite_mask\": {\n",
        "          \"url\": \"https://api.labelbox.com/api/v1/tasks/{task_id}/masks/{composite_mask_id}/index/1\",\n",
        "          \"color_rgb\": [\n",
        "              123,\n",
        "              103,\n",
        "              152\n",
        "          ]\n",
        "      }\n",
        "    }\n",
        "```\n",
        "- rgb(123,103,152) = Purple\n"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "---"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "#### Single mask instance:\n",
        "We are planning on removing single mask instances, but for now they will be displayed adjecent to the composite mask.\n",
        "1. A single mask instance and mask url is generated for each individual annotation for each label.\n",
        "2. The export and mask URL adhere to the following convention:  \n",
        "```json\n",
        "      {\n",
        "        \"mask\": {\n",
        "              \"url\": \"https://api.labelbox.com/api/v1/projects/{project_id}/annotations/{feature_id}/index/1/mask\"\n",
        "          }\n",
        "      }\n",
        "\n",
        "```\n",
        "3. RGB color is not present"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "## Create an export from an Image project with mask annotations\n",
        "To better showcase composite masks, make sure you have different mask tools and mask annotations in your project"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "# Insert the project ID of the project from which you wish to export data rows.\n",
        "PROJECT_ID = \"\"\n",
        "project = client.get_project(PROJECT_ID)"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "export_params= {\n",
        "  \"attachments\": True,\n",
        "  \"metadata_fields\": True,\n",
        "  \"data_row_details\": True,\n",
        "  \"project_details\": True,\n",
        "  \"label_details\": True,\n",
        "  \"performance_details\": True,\n",
        "  \"interpolated_frames\": True\n",
        "}\n",
        "\n",
        "filters= {}\n",
        "\n",
        "# export() is the streamable option of exports V2, for more information please visit our documentation:\n",
        "# https://docs.labelbox.com/reference/label-export#export-v2-methods\n",
        "\n",
        "export_task = project.export(params=export_params, filters=filters)\n",
        "export_task.wait_till_done()\n",
        "\n",
        "if export_task.has_result():\n",
        "  print(export_task.result)"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "#### Get all the ```color_rgb``` associated with annotations that are using a specific mask tool "
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "stream = export_task.get_stream()\n",
        "\n",
        "mask_tool_rgb_mapping = {}\n",
        "\n",
        "for output in stream:\n",
        "    # Parse the JSON string from the output\n",
        "    output_json = json.loads(output.json_str)\n",
        "\n",
        "    # Get the labels for the specified project ID or an empty list if the project ID is not found\n",
        "    project_labels = output_json['projects'].get(PROJECT_ID, {}).get('labels', [])\n",
        "\n",
        "    # Iterate through each label\n",
        "    for label in project_labels:\n",
        "        # Get the list of annotations (objects) for the label\n",
        "        annotations = label['annotations'].get('objects', [])\n",
        "\n",
        "        # Iterate through each annotation\n",
        "        for annotation in annotations:\n",
        "            # Check if the annotation is of type \"ImageSegmentationMask\"\n",
        "            if annotation.get('annotation_kind') == \"ImageSegmentationMask\":\n",
        "                # Add the color RGB information to the mapping dictionary\n",
        "                mask_tool_rgb_mapping.setdefault(annotation['name'], []).append(annotation['composite_mask']['color_rgb'])\n",
        "\n",
        "print(mask_tool_rgb_mapping)"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "## Create an export from a Video project with mask annotations "
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "VIDEO_PROJECT_ID = \"\"\n",
        "project_video = client.get_project(VIDEO_PROJECT_ID)"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "export_params= {\n",
        "  \"attachments\": True,\n",
        "  \"metadata_fields\": True,\n",
        "  \"data_row_details\": True,\n",
        "  \"project_details\": True,\n",
        "  \"label_details\": True,\n",
        "  \"performance_details\": True,\n",
        "  \"interpolated_frames\": True\n",
        "}\n",
        "\n",
        "filters= {}\n",
        "\n",
        "# export() is the streamable option of exports V2, for more information please visit our documentation:\n",
        "# https://docs.labelbox.com/reference/label-export#export-v2-methods\n",
        "\n",
        "export_task_video = project_video.export(params=export_params, filters=filters)\n",
        "export_task_video.wait_till_done()\n",
        "\n",
        "if export_task_video.has_result():\n",
        "  print(export_task_video.result)\n"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    },
    {
      "metadata": {},
      "source": [
        "#### Get all the ```color_rgb``` associated with annotations that are using a specific mask tool from each frame"
      ],
      "cell_type": "markdown"
    },
    {
      "metadata": {},
      "source": [
        "tools_frames_color = {}\n",
        "stream = export_task_video.get_stream()\n",
        "\n",
        "# Iterate over each output in the stream\n",
        "for output in stream:\n",
        "    output_json = json.loads(output.json_str)\n",
        "\n",
        "    # Iterate over the labels in the specific project\n",
        "    for dr in output_json[\"projects\"][VIDEO_PROJECT_ID][\"labels\"]:\n",
        "        frames_data = dr[\"annotations\"][\"frames\"]\n",
        "\n",
        "        # Iterate over each frame in the frames data\n",
        "        for frame_key, frame_value in frames_data.items():\n",
        "\n",
        "            # Iterate over each annotation in the frame\n",
        "            for annotation_key, annotation_value in frame_value.items():\n",
        "                if 'objects' in annotation_key and annotation_value.values():\n",
        "\n",
        "                    # Iterate over each object in the annotation\n",
        "                    for object_key, object_value in annotation_value.items():\n",
        "                        if object_value['annotation_kind'] == 'VideoSegmentationMask':\n",
        "                            # Update tools_frames_color with object information\n",
        "                            tools_frames_color.setdefault(object_value['name'], []).append({frame_key: object_value['composite_mask']['color_rgb']})\n",
        "\n",
        "print(tools_frames_color)"
      ],
      "cell_type": "code",
      "outputs": [],
      "execution_count": null
    }
  ]
}